package com.example.MyProject;

import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;

/**
 * Created with IntelliJ IDEA.
 * User: student
 * Date: 8/21/13
 * Time: 2:50 PM
 * To change this template use File | Settings | File Templates.
 */
public class Second extends Activity {

    public static final String PREFS_NAME = "MyPreferencesFile";

    public void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
        setContentView(R.layout.second);

        TextView   tvName = (TextView)findViewById(R.id.textViewName);
        TextView tvMail = (TextView)findViewById(R.id.textViewMail);

        SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
        tvName.setText(settings.getString("name", "John"));
        tvMail.setText(settings.getString("mail", "Hello@dot.com"));

}
}
